package com.example.backed.vo;

import lombok.Data;
import java.util.Collections;
import java.util.List;

@Data
public class PageVO<T> {
    /**
     * 总记录数
     */
    private Integer total;

    /**
     * 当前页数据
     */
    private List<T> list;

    /**
     * 页码
     */
    private Integer pageNum;

    /**
     * 每页大小
     */
    private Integer pageSize;
    
    /**
     * 有参构造函数
     */
    public PageVO(List<T> list, Integer total, Integer pageNum, Integer pageSize) {
        this.list = list;
        this.total = total;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }
    
    /**
     * 无参构造函数
     */
    public PageVO() {
    }

    public static <T> PageVO<T> empty() {
        return new PageVO<>(Collections.emptyList(), 0, 1, 10);
    }
} 